<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>服务入口</title>
		<link rel="stylesheet" type="text/css" href="css/home.css" />
		<link rel="stylesheet" type="text/css" href="css/layer.css" />
		<script src="js/layer.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/vconsole.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var vConsole = new VConsole();
			function onclickaction() {
				//ios
				window.webkit.messageHandlers.pushNavigationBar.postMessage("push");
				//安卓android
				//				window.Android.postMessage("push"); 
			}
		</script>
	</head>

	<body class="backgroundF">
		<header id="iosbox" class="positionR colorF height7 none" onclick="onclickaction()">
			<img src="img/pinggu_sq/03.png" onclick="onclickaction()" />
			<div class="height30"></div>
			<div class="textC font1-4">医养</div>
		</header>
		<img class="width100 height30" src="img/home/01.jpg" />
		<ul class="main width90 Mauto radius10P overflowH font1-2">
			<li onclick="gourl_pg('page/pinggu_sq/list.html')">
				<div class="height20"></div>
				<div class="width50 Mauto">
					<img src="img/home/07.png" />
				</div>
				<div class="height10"></div>
				评估申请
			</li>
			<li onclick="gourl('page/pinggu_sq/pinggulist.html')">
				<div class="bord height100 fl"></div>
				<div class="height20"></div>
				<div class="width50 Mauto">
					<img src="img/home/06.png" />
				</div>
				<div class="height10"></div>
				评估评价
			</li>
			<li onclick="gourl('page/fuwu_sq/fuwu_index.html')">
				<div class="bord height100 fl"></div>
				<div class="height20"></div>
				<div class="width50 Mauto">
					<img src="img/home/05.png" />
				</div>
				<div class="height10"></div>
				服务申请
			</li>
			<li onclick="gourl('page/service_order/list.html')">
				<div class="height20"></div>
				<div class="width50 Mauto">
					<img src="img/home/04.png" />
				</div>
				<div class="height10"></div>
				服务工单
			</li>
			<li>
				<div class="bord height100 fl"></div>
				<div class="height20"></div>
				<div class="width50 Mauto">
					<img src="img/home/03.png" />
				</div>
				<div class="height10"></div>
				紧急求助
			</li>
			<li>
				<div class="bord height100 fl"></div>
				<div class="height20"></div>
				<div class="width50 Mauto">
					<img src="img/home/02.png" />
				</div>
				<div class="height10"></div>
				体征检测
			</li>
		</ul>
		<div class="allcommomn_backdrop textC radius10P"><img class="height3R" src="img/home/loading.gif" /></div>
		<script src="js/jquery-1.7.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/common.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var login_status = false; //登录状态
//			localStorage.clear(); //清除缓存
			if(iosipone) {
				document.getElementById("iosbox").setAttribute("style", "display: block;")
			}
			var tamentokken='';
			 //安卓
			function FromJavaLoginInfo() {
				//调用android程序中的方法，并传递参数
				var result = window.AndroidWebView.getLoginInfo();
				tamentokken=JSON.parse(result.substring(0,result.length-1))
				tamen()
			}
			FromJavaLoginInfo();
//			window.AndroidWebView.sendBroad();	
			function tamen() {
				$.ajax({
					type: 'POST',
					url: 'http://221.0.79.248:8082/api/gzd/getUserInfo.service',
					headers: {
						"AUTH_KEY_JKCS": tamentokken.AUTH_KEY_JKCS,
						"AUTH_KEY_JKCStimestamp": tamentokken.AUTH_KEY_JKCStimestamp,
					},
					data: "",
					success: function(result) {
						console.log("result:")
						console.log(result);
						console.log("result.data");
						console.log(result.data)
						if(result.code == 'ERROR-AUTH-UNLOGIN_AUTH_KEY_JKCS') {
							//询问框
							layer.open({
								content: '登陆信息超时，请重新登陆？',
								btn: ['退出'],
								yes: function(index) {
									window.AndroidWebView.sendBroad();	
									layer.close(index);
								}
							});
						} else {
							ajaxhome(result.data.sfzh, result.data.xb, result.data.sj, result.data.csrq, result.data.czd, result.data.xm)
						}
						//localStorage.user_info=main; 
					}
				})
			}
//			tamen();
//			ajaxhome("14273319790216032X"); //测试需要正式版本需要注释
			function ajaxhome(zjhm, xb, mobilePhone, csrq, address, xm) {
				ajaxPost(
					Url.PGAPPLY_CHECK, {
						type: 'elder',
						zjhm: zjhm,
						address: address,
						xm: xm,
						xb: xb,
						mobilePhone: mobilePhone,
						csrq: csrq,
						sbkh: ''
					},
					function(data) {
						console.log(data)
						if(data.status == "1") {
							login_status = true;
							localStorage.user_info = JSON.stringify(data.response)
						}
					}
				)
			}

			function shenfen() {
				ajaxPost(
					'http://172.16.25.95:8091/WebDemo/rest/medical/account/getUserInfo', {
						cookieId: 'AUTH_KEY_JKCS',
						cookieVal: '094f01cf-f01d-46d1-b5cb-410c8db59c4f'
					},
					function(data) {
						console.log(data)
						if(data.status == "1") {
							login_status = true;
							localStorage.user_info = JSON.stringify(data.response)
						}
					}
				)
			}

			function gourl(url) {
				if(login_status) {
					window.location.href = url;
				}
			}

			function gourl_pg(url) {

				window.location.href = url;

			}
		</script>
	</body>

</html>